<?php
class Lottery_reseller_model extends CI_Model
{
    private $table   = 'lottery_reseller';

    /**
     * 查找 抽奖的关联账号
     */
    public function findByName($lotteryId, $usernames)
    {
        $this->db->select('id, reseller_uid, reseller_name');
        $this->db->from($this->table);
        $this->db->where('lottery_id', (int)$lotteryId);
        $this->db->where_in('reseller_name', $usernames);
        $this->db->limit(2);
        return $this->db->get();
    }
}